\documentclass[a4paper,12pt,T2A,oneside]{article}
\usepackage[english]{babel}
\usepackage{indentfirst}
\usepackage{amsmath}
\usepackage{amsxtra}
\usepackage{amssymb}
\usepackage{amsfonts}
\usepackage{graphicx}
\usepackage{subfigure}
\usepackage{float}
\usepackage{fancyhdr}
\usepackage[pdfborder=0 0 0]{hyperref}
\usepackage{listings}
\lstset{
	tabsize=2
}


%define the header
\pagestyle{fancy}
\fancyhf[ROH,LEH]{\nouppercase\leftmark} %prints current section
\fancyhf[REH,LOH]{\bfseries Around(J2)ME} %report title (fixed)

\begin{document}
\newcommand{\R}{\mathbb{R}}
\newcommand{\s}{\mathbb{S}}
\newtheorem{definition}{Definition}
\newtheorem{formula}{}


\title{Around(J2)ME \\ \small{\url{http://aroundj2me.googlecode.com}}}
\author{\small{Braunhofer Matthias (3098), Strumpflohner Juri (3195)} 
\\ \small{Mobile Services}
\\ \small{Free University of Bozen-Bolzano}}
\date{June 9, 2009}
\maketitle

\begin{abstract}
This report describes the Around(J2)ME midlet application that has been
developed as a project for the Mobile Services course at the Free University of
Bozen-Bolzano. The aim of the application is to provide information what
is around the user (e.g. banks, bars, pubs, restaurants) using the mobile
phone's current location. In particular, the report presents the system
functionalities, the architecture, the user interface, development strategies
and technical problems that have been discovered during development. 

\end{abstract}

\pagebreak

\tableofcontents

\pagebreak

\section{System functionalities}
\label{section_systemFunctionalities}

\subsection{General description of the major user functions}
Around(J2)ME is a location-based J2ME application that uses the phone's current
location in order to provide all nearby places that are either belonging to a
pre-defined category (e.g. banks, bars, pubs, restaurants, taxis, theaters,
parking) or that match a certain search criteria (e.g. name, description,
address). Similar to a car navigation system, the user is able to connect to
the Around(J2)ME-server to download location-related data organized into
continents (i.e. Africa, Asia, Europe, North America and South America) to the
mobile device. The user can then browse the retrieved locations offline
without having to rely on network connectivity. Furthermore the current
position and the place of interest can be displayed on a Google Map for
a better understanding of its location.

\subsection{Use case diagram}
\begin{figure}[H]
	\begin{center}
		\includegraphics[width=10cm,height=8cm]{./images/UseCaseDiagram1.png}
		\caption{Use case diagram}
		\label{useCaseDiagram}
	\end{center}
\end{figure}

\subsection{Detailed description of the use cases}

\begin{table}[H]
\begin{center}
\begin{tabular}{|p{4.5cm}|p{8.5cm}|}
  \hline
  \textbf{Name} & Find nearby places \\
  \hline
  \textbf{Description} & The user has the possibility to select a category 
 	from a list of possible ones (e.g. banks, bars, pubs, restaurants,
 	taxis, theaters, parking) which are provided by the application. By choosing a
  	category, the application will retrieve all places that are nearby the user's
  	current position. \\
  \hline
\end{tabular}
\caption{Find nearby places} \label{useCaseNearbyPlaces}
\end{center}
\end{table}

\begin{table}[H]
\begin{center}
\begin{tabular}{|p{4.5cm}|p{8.5cm}|}
  \hline
  \textbf{Name} & Find nearby places by category \\
  \hline
  \textbf{Description} & The user has the possibility to select a category 
 	from a list of possible ones (e.g. banks, bars, pubs, restaurants,
 	taxis, theaters, parking) which are provided by the application. By choosing a
  	category, the application will retrieve all places that are nearby the user's
  	current position. \\
  \hline
\end{tabular}
\caption{Find nearby places by category} \label{useCaseByCategory}
\end{center}
\end{table}

\begin{table}[H]
\begin{center}
\begin{tabular}{|p{4.5cm}|p{8.5cm}|}
  \hline
  \textbf{Name} & Find nearby places by search criteria \\
  \hline
  \textbf{Description} & The user can open a search form on the mobile phone
  where he can enter a search query. By clicking on the search button, a
  search for places matching the entered search query and being around the
  current location of the user will be done and the result displayed to the
  user.\\
  \hline
\end{tabular}
\caption{Find nearby places by search criteria} \label{useCaseByCriteria}
\end{center}
\end{table}

\begin{table}[H]
\begin{center}
\begin{tabular}{|p{4.5cm}|p{8.5cm}|}
  \hline
  \textbf{Name} & View place \\
  \hline
  \textbf{Description} & By clicking on the different places on the list, found
	 by one of the different possibilities (see use cases
	 \ref{useCaseNearbyPlaces}, \ref{useCaseByCategory} and
	 \ref{useCaseByCriteria}), the user can view the details about that place. This
	 detail view shows information such as the distance from the user's current
	 position, address information (i.e. street, city,\ldots), contact information
	 such as the phone number and a short textual description about the place of
	 interest. \\
  \hline
\end{tabular}
\caption{View place} \label{useCaseViewPlace}
\end{center}
\end{table}

\begin{table}[H]
\begin{center}
\begin{tabular}{|p{4.5cm}|p{8.5cm}|}
  \hline
  \textbf{Name} & View place on map \\
  \hline
  \textbf{Description} & When viewing a place found by one of the
  different possibilities (see use cases \ref{useCaseNearbyPlaces},
  \ref{useCaseByCategory} and \ref{useCaseByCriteria}), the user can display
  this place on a map.  \\
  \hline
\end{tabular}
\caption{View place on map} \label{useCaseViewOnMap}
\end{center}
\end{table}

\begin{table}[H]
\begin{center}
\begin{tabular}{|p{4.5cm}|p{8.5cm}|}
  \hline
  \textbf{Name} & Manage location data \\
  \hline
  \textbf{Description} & All of the location data is managed locally on the
  device. The user can manage this data by retrieving/updating it from the
  server. The places can be downloaded for each continent indipendently.
  \\
  \hline
\end{tabular}
\caption{Manage location data} 
\label{useCaseManageData}
\end{center}
\end{table}

\pagebreak

\section{Architecture}
\label{section_architecture}


\subsection{Used libraries and software tools}
The following table shows the tools and libraries that have been used for the
development of the Around(J2)ME application.
\begin{table}[H]
	\begin{center}
	\begin{tabular}{p{2cm}| p{7cm}| p{6cm} }
	  \textbf{Name} & \textbf{Description} & \textbf{URL} \\
	  \hline \hline
	  Eclipse & Main development IDE & \url{http://www.eclipse.org} \\
	  WTK & Sun Wireless Toolkit &
	  \url{http://java.sun.com/products/sjwtoolkit/download.html} \\
	  MTJ & Eclipse plugin Mobile Tools for Java (former EclipseME) &
	  \url{http://www.eclipse.org/dsdp/mtj/} \\
	  Apache Tomcat & Used webserver & \url{http://tomcat.apache.org/} \\
	  kXML2 & XML  pull parser library & \url{http://kxml.sourceforge.net/} \\
	  J2MEUnit & Unit testing library for J2ME & 
	  \url{http://j2meunit.sourceforge.net/} \\
	  JSR-179 & Location API & 
	  \url{http://jcp.org/en/jsr/detail?id=179}
	\end{tabular}
	\caption{libraries and tools used for development}
	\label{table_usedDevTools}
	\end{center}
\end{table}

\subsection{Internal logic}
This section describes the internal logic of the application in terms of
appropriate UML diagrams.

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=13.5cm,height=9cm]{./images/packageDiagram.png}
		\caption{Packages}
		\label{fig_packages}
	\end{center}
\end{figure}

\subsubsection{Package ``com.aroundj2me.main''}
\label{section_pkg_com.aroundj2me.main}
\begin{figure}[H]
	\begin{center}
		\includegraphics[width=7cm,height=4.5cm]{./images/com_aroundj2me_main.png}
		\caption{Packages}
		\label{fig_packages}
	\end{center}
\end{figure}
\begin{table}[H]
	\begin{tabular}{p{4cm}| p{9cm} }
  		\textbf{Class} & \textbf{Description} \\
  		\hline \hline
		AroundJ2ME & This is the application MIDlet and is the entry point of the
		Around(J2)ME application. This class is responsible for starting up the
		application and for calling the appropriate application initialization
		methods.
	\end{tabular}
\end{table}

\subsubsection{Package ``com.aroundj2me.location''}
\label{section_pkg_com.aroundj2me.location}
\begin{figure}[H]
	\begin{center}
		\includegraphics[width=7cm,height=6cm]{./images/com_aroundj2me_location.png}
		\caption{Packages}
		\label{fig_packages}
	\end{center}
\end{figure}
\begin{table}[H]
	\begin{tabular}{p{4cm}| p{9cm} }
  		\textbf{Name} & \textbf{Description} \\
  		\hline \hline
		LocationService & The LocationService is the central point of interaction
		with the JSR-179 Location API. It provides methods for retrieving the current
		location as well as for storing and retrieving Landmark objects to and from
		the LandmarkStore.
	\end{tabular}
\end{table}

\subsubsection{Package ``com.aroundj2me.controller''}
\label{section_pkg_com.aroundj2me.controller}
\begin{figure}[H]
	\begin{center}
		\includegraphics[width=13cm,height=6.5cm]{./images/com_aroundj2me_controller.png}
		\caption{Packages}
		\label{fig_packages}
	\end{center}
\end{figure}
\begin{table}[H]
	\begin{tabular}{p{4cm}| p{9cm} }
  		\textbf{Name} & \textbf{Description} \\
  		\hline \hline
		ApplicationController & This class contains the main domain logic. It is the
	 	main point of interaction between the user interface. Each user interface
	 	class contains a reference to the ApplicationController. For more details
	 	about this MVC-like structure refer to section
	 	\ref{section_mvc}. \\ \\
	 	
	 	ScreenController &
	 	The ScreenController class is responsible for managing the different kind of
	 	J2ME Displayable objects on the UI. All the displaying and removing of
	 	Displayable objects is done over this class. This guarantees to have a
	 	single point of handling UI windows and a clean structure throughout the
	 	application. For managing the different Displayable's, this class uses a
	 	Stack (java.util.Stack) datastructure. Moreover it includes
	 	convenient functionalities such as to automatically add a ``back'' command to
	 	the Displayable that is being displayed. More in section
	 	\ref{section_screenController}
	\end{tabular}
\end{table}

\subsubsection{Package ``com.aroundj2me.model''}
\label{section_pkg_com.aroundj2me.model}
\begin{figure}[H]
	\begin{center}
		\includegraphics[width=13cm,height=12cm]{./images/com_aroundj2me_model.png}
		\caption{Packages}
		\label{fig_packages}
	\end{center}
\end{figure}
\begin{table}[H]
	\begin{tabular}{p{4cm}| p{9cm} }
  		\textbf{Name} & \textbf{Description} \\
  		\hline \hline
		Place & This is the class for holding data of
	 	a place retrieved from the local landmark store that is being displayed on 
	 	the UI to the user.
	 
	\end{tabular}
\end{table}
\begin{table}[H]
	\begin{tabular}{p{4cm}| p{9cm} }
  		\textbf{Name} & \textbf{Description} \\
  		\hline \hline
  		ContinentPack & This class is used for transporting the data about
		installed continents.	\\ \\
		
		ExecutableTask & This abstract class is being inherited by classes
		that encapsulate so-called ``executable tasks". This is a pattern that has
		been used in the Around(J2)ME application for handling threaded code in a
		uniform and convenient way. For more information please refer to section
		\ref{section_executableTaskPattern}. \\ \\
				
		TaskProcessListener & This is an abstract class that is used for attaching to
		the execution of an ExecutableTask for getting notified about the successful
		termination or occurence of errors.	\\	\\
		
		Constants & This class contains commonly used constants throughout the 
		application	\\ \\
		
		CategoryName & This is a class containing all of the category names as
		constant strings in order to have a central point in the program for changing
		category names. \\ \\
		
		ContinentName & Similar to the CategoryName, this class holds constant
		strings for all of the available continents.	\\ \\
		
		Messages & This class holds the messages that are being displayed to the user
		on the UI.	\\ \\
		
		BackCommand & This class extends the
		javax.microedition.lcdui.Command class and is used by the ScreenController to automatically hook a ``back'' command 
		on the Displayable objec that is being shown on the UI.	\\
	\end{tabular}
\end{table}

\subsubsection{Package ``com.aroundj2me.view''}
\label{section_pkg_com.aroundj2me.view}
\begin{figure}[H]
	\begin{center}
		\includegraphics[width=12cm,height=10cm]{./images/com_aroundj2me_view.png}
		\caption{Packages}
		\label{fig_packages}
	\end{center}
\end{figure}
\begin{table}[H]
	\begin{tabular}{p{4cm}| p{9cm} }
  		\textbf{Class} & \textbf{Description} \\
  		\hline \hline
		IView & This is the interface that is implemented by all of the view classes 
		defined in the application. This construct facilitates the easy construction
		and reuse of view objects in the application.\\	\\
		
		CategoryListView & This is the UI list where all of the available categories
		are displayed to the user. The user can choose a category for getting all of
	 	the according places.		
	\end{tabular}
\end{table}
\begin{table}[H]
	\begin{tabular}{p{4cm}| p{9cm} }
  		\textbf{Class} & \textbf{Description} \\
  		\hline \hline
  		ContinentListView & This is the list showing all the available continents.
		Here the the user can download or update his places from the server.
		Appropriate icons show whether a certain continent with its data is already
		installed or whether it has still to be downloaded.	\\ \\
  		
		MapView & This view shows a Google Map with the current position of the user
	 	marked with a red point and the desired place with a blue point. \\ \\
		
		PlaceListView & This is the list displayed to the user with all of the
		retrieved nearby places. \\	\\
		
		PlaceView & On this view, the details about the selected pace such as the
		title, description, address etc\ldots are displayed to the user. \\ \\
		
		SearchView & This is the view where the user can enter search queries for
		retrieving nearby places.	\\	\\
		
		SplashScreen & This is the initial splash screen that is shown during
		initialization at the application startup.	\\	\\
		
		AboutForm & This is a view for showing information related to the Around(J2)ME
		application such as the version and the authors. \\ \\
		
		IProgressForm & This is the interface for views showing progress information
		to the user. It defines the methods that should be implemented. \\ \\
		
		ProgressForm & This class implements IProgressForm and displays a progress
		bar together with a status message for informing the user about the ongoing operations.
	\end{tabular}
\end{table}

\subsubsection{Package ``com.aroundj2me.executableTasks''}
\label{section_pkg_com.aroundj2me.executableTasks}
\begin{figure}[H]
	\begin{center}
		\includegraphics[width=9.5cm,height=6cm]{./images/com_aroundj2me_executableTasks.png}
		\caption{Packages}
		\label{fig_packages}
	\end{center}
\end{figure}
All of the classes extend the abstract class ``ExecutableTask''. For more
information about this kind of pattern see section
\ref{section_executableTaskPattern}.

\begin{table}[H]
	\begin{tabular}{p{4cm}| p{9cm} }
  		\textbf{Class} & \textbf{Description} \\
  		\hline \hline
		PlaceFinder & This class is responsible for reading the places
	 	that match the current user's location from the local landmark store. \\ \\
	 	
		ContinentRetriever & This class is responsible for establishing a connection
	 	to the server and for downloading the according data for the continent
	 	chosen by the user. \\ \\
		
		GoogleMapsRetriever & This class is responsible for contacting the Google
		Maps API for retrieving the map for displaying the user's location and
		selected point of interest.	\\ \\
	\end{tabular}
\end{table}

\subsubsection{Package ``com.aroundj2me.utility''}
\label{section_pkg_com.aroundj2me.utility}
\begin{figure}[H]
	\begin{center}
		\includegraphics[width=10cm,height=7.5cm]{./images/com_aroundj2me_utility.png}
		\caption{Packages}
		\label{fig_packages}
	\end{center}
\end{figure}
\begin{table}[H]
	\begin{tabular}{p{4cm}| p{9cm} }
  		\textbf{Name} & \textbf{Description} \\
  		\hline \hline
		ImageLoader & This class provides static constants with the uri to the
		corresponding images and a static utility method for loading them and
		creating the according in-memory image object.	\\ \\
		
		StringUtils & This class contains utility methods for working with strings 
		which are missing in the J2ME library such as replace and split methods. \\ \\
		
		HttpCommunicator & This class provides the logic for performing HTTP calls
		and for reading the returned data.	\\ \\
		
		AlertCreator & This class contains utility methods for creating various Alert
		objects to be displayed on the screen. \\ \\
	\end{tabular}
\end{table}

\subsubsection{Package ``com.aroundj2me.xml''}
\label{section_pkg_com.aroundj2me.xml}
\begin{figure}[H]
	\begin{center}
		\includegraphics[width=5cm,height=4cm]{./images/com_aroundj2me_xml.png}
		\caption{Packages}
		\label{fig_packages}
	\end{center}
\end{figure}
\begin{table}[H]
	\begin{tabular}{p{4cm}| p{9cm} }
  		\textbf{Name} & \textbf{Description} \\
  		\hline \hline
		XMLDecoder & This class is responsible for parsing XML documents by using the
		XML pull parser technology (kXML).	\\
	\end{tabular}
\end{table}

\subsubsection{Package ``com.aroundj2me.uicomponents''}
\label{section_pkg_com.aroundj2me.uicomponents}
\begin{figure}[H]
	\begin{center}
		\includegraphics[width=10cm,height=4.5cm]{./images/com_aroundj2me_uicomponents.png}
		\caption{Packages}
		\label{fig_packages}
	\end{center}
\end{figure}
\begin{table}[H]
	\begin{tabular}{p{4cm}| p{9cm} }
  		\textbf{Name} & \textbf{Description} \\
  		\hline \hline
		HLine & This is a custom UI component that is used for drawing a
		horizontal line on the screen in order to separate different UI parts. \\ \\
		
		ImageButton & This class is a custom UI component that draws an image button
	 	on the UI.	\\ \\
	\end{tabular}
\end{table}

\subsection{Client - Server communication}
The main application logic is performed offline, without relying on a server
for providing the data. The only communication with the server is for
downloading the location data to the client where it is then stored for
performing operations locally.

The application connects to the server by performing a HTTP GET operation
passing the continent as parameter. The server processes the request and
encodes the result as XML file which is sent back to the mobile client. There
the result is parsed by using the kXML parser and stored locally inside a
LandmarkStore.
\begin{figure}[H]
	\begin{center}
		\includegraphics[width=13cm,height=3.5cm]{./images/ClientServerCommunication.jpg}
		\caption{Free form diagram showing the client - server communciation}
		\label{fig_clientServerComm}
	\end{center}
\end{figure}

\subsection{MVC like structuring}
\label{section_mvc}
For separating the user interface logic, the domain logic and the model classes,
a very simplified MVC like structure has been used. Mostly the concept of the
layering and decoupling has been taken from the MVC pattern.
\begin{itemize}
  \item \textbf{Controller} \\
  	The ApplicationController class plays the role of the controller. All of the
  	calls to the actual application logic go through this class. It functions as
  	a mediator that gets the UI actions initiated from the user's interaction,
  	executes the appropriate actions on the different domain classes (model) and
  	then displays the changed model data again on the user interface. \\
  \item \textbf{Model} \\
  	The model part of the MVC is represented by the classes in the
  	com.aroundj2me.model package. These are the classes that contain the data
  	that is being displayed (by the ApplicationController) on the UI. \\
  \item \textbf{View} \\
  	The view part is represented by the classes in the com.aroundj2me.view
  	package. All of these classes contain mainly user interface related logic
  	such as constructing the appropriate elements for showing the data and for
  	handling user events.
\end{itemize}

It has to be stated that a full implementation of the MVC pattern has been
avoided for minimizing the amount of objects that are involved in such a
structure. The
MVC\footnote{\url{http://blog.js-development.com/2008/03/logical-separation-with-mvc.html}}
or MVP\footnote{\url{http://martinfowler.com/eaaDev/ModelViewPresenter.html}, 
\url{http://msdn.microsoft.com/en-us/library/cc304760.aspx}} model in a J2SE
or J2EE environment involves a lot of objects and event handling which could pose a possible overhead on the mobile device.
\\

\pagebreak

\section{User interface}
\label{userInterface}
This section shows some screenshots presenting the main functionalities of the
Around(J2)ME application.

\begin{figure}[H]
	\begin{center}
		\subfigure[Main menu]{\includegraphics[width=5.5cm,height=7cm]{./images/app_mainMenu.jpg}}
		\subfigure[Manage
		places]{\includegraphics[width=5.5cm,height=7cm]{./images/app_managePlaces.jpg}}
		\subfigure[Places search]{\includegraphics[width=5.5cm,height=7cm]{./images/app_placesSearch.jpg}}
		\subfigure[Information message]{\includegraphics[width=5.5cm,height=7cm]{./images/app_infoMessage.jpg}}
		\caption{Screenshots showing the main functionalities}
		\label{fig_around(j2me)screenshots}
	\end{center}
\end{figure}

\begin{figure}[H]
	\begin{center}
		\subfigure[Places by
		category]{\includegraphics[width=5.5cm,height=7cm]{./images/app_placesByCategory.jpg}} 
		\subfigure[Nearby
		places]{\includegraphics[width=5.5cm,height=7cm]{./images/app_nearbyPlacesResult.jpg}}
		\subfigure[Place detail
		view]{\includegraphics[width=5.5cm,height=7cm]{./images/app_placeDetailView.jpg}}
		\subfigure[Progress indicator]{\includegraphics[width=5.5cm,height=7cm]{./images/app_progressIndicator.jpg}}		
		\caption{Screenshots showing the main functionalities}
		\label{fig_around(j2me)screenshots}
	\end{center}
\end{figure}

\begin{figure}[H]
	\begin{center}
		\subfigure[Map view	normal]{\includegraphics[width=5.5cm,height=7cm]{./images/app_mapViewNormalWithMenu.jpg}} 
		\subfigure[Map view
		satellite]{\includegraphics[width=5.5cm,height=7cm]{./images/app_mapViewSatellite.jpg}}
		\subfigure[Map view
		hybrid]{\includegraphics[width=5.5cm,height=7cm]{./images/app_mapViewHybrid.jpg}}
		\caption{Screenshots showing the main functionalities}
		\label{fig_around(j2me)screenshots}
	\end{center}
\end{figure}

\pagebreak

\section{Development strategies}
\label{developmentStrategies}

\subsection{Handling location data}
Location data is managed by heavily using the JSR-179 Location API. Places are
represented by the Location API's Landmark class, which are stored inside a
LandmarkStore together with appropriate categories. There is one landmark store
for each continent.

When the user wants to retrieve places around his current position by one of
the available functionalities (either through a search, by a certain category or
just all nearby places), the local landmark stores are queried for locations of
about 3 kilometers around the user's current position.

\subsection{JUnit testing}
The J2MEUnit\footnote{http://j2meunit.sourceforge.net/} library has been used
for writing JUnit tests for the mobile device. This ensured the proper working
of the implemented features during the development lifecycle.

\begin{figure}[H]
	\begin{center}
		\includegraphics[width=5.5cm,height=7cm]{./images/jUnitTestRunner1.jpg}
		\includegraphics[width=5.5cm,height=7cm]{./images/jUnitTestRunnerResults.jpg}
		\caption{JUnit tests running on the WTK simulator}
		\label{fig_jUnitTests}
	\end{center}
\end{figure}

\subsection{ExecutableTask ``pattern''}
\label{section_executableTaskPattern}
When developing J2ME applications there are always again operations that have to
be launched inside a separate thread in order to first not block the main user
interface and second to be able to provide valuable information at the same
time to the user, e.g. a progress window about the ongoing operation. In order
to have the same reusable structure for handling these threaded operations
throughout the Around(J2)ME application, a so-called ``Executable task
pattern'' has been created.

The base classes involved in this construct are the ExecutableTask
and the TaskProcessListener. Both are abstract classes and get implemented by
the actual executable task classes (see section
\ref{section_pkg_com.aroundj2me.executableTasks}). The ExecutableTask
implements the runnable interface for being launched inside a thread and it
accepts a TaskProcessListener for being notified about the status of the
ongoing operation.

Executing an operation that extends the ExecutableTask class can then be
handled in this simple way:
\begin{lstlisting}[language=java]
executableTask.setListener(new TaskProcessListener() {
	public void onError(String status) {
		//an error happened, notify the user
	}

	public void taskFinished(Object result) {
		//everything went fine.. 
		//do something with the ``result''
	}
});
..
Thread t = new Thread(executableTask);
t.start();
\end{lstlisting}

\subsection{The ScreenController - managing Displayables}
\label{section_screenController}
Mobile phones don't dispose of a multi-window environment as in normal desktop
environments. Always just one window at a time can be shown on the display
where users can usually navigate forward and backward between different
windows. This kind of behaviour matches perfectly a stack datastructure: if the
user navigates to a new screen, the current screen will be pushed on the stack.
When the user activates the back button, the last screen will be popped from
the stack and again displayed.

These kind of operations are managed by the ScreenController. It is a singleton
class that is used throughout the Around(J2)ME application as a central point
for handling display related operations. 

\pagebreak

\section{Technical problems}
\label{technicalProblems}

\subsection{Location API - Landmark, LandmarkStore and Categories}
One of the major technical issues that have been encountered during development
was a problem with the JSR-179 Location API. Around(J2)ME uses categories such
as ``Bars, Restaurants, Pubs, Hotels,\ldots'' for organizing places. These
categories are associated to the landmarks when they are persisted in the
LandmarkStore. When retrieving a certain landmark from the store it is however
not possible to know which kind of category it has associated. A Landmark
object has an array of associated categories but provides no public accessor
for retrieving it.
\begin{figure}[H]
	\begin{center}
		\includegraphics[width=7cm,height=1.7cm]{./images/LandmarkIntellisense.jpg}
		\caption{Landmark's categories array not publicly accessible}
		\label{fig_landmarkIntellisense}
	\end{center}
\end{figure}
Such information is however needed by the Around(J2)ME application. When the
user retrieves nearby places without any restriction, he would like to know
immediately which kind of category a found place belongs to. For instance
whether it is a bar, pub or restaurant. As a workaround, the description field
of the Landmark class has been used to store the category information.

\pagebreak

\section{Future development}
Future development of the application could go in the direction of extending
the server logic for providing features like
\begin{itemize}
  \item letting the user enter new interesting places locally and submit
  them to the server.
  \item letting the user rate/comment places (i.e. rate restaurants, pubs,
  bars\ldots)
\end{itemize}

Another feature could be to enhance the navigation support, that is, enhancing
the Google Map to continuously track and update the user's position on the map
by exploiting the LocationListener of the JSR-179 Location API.
 
% Stop your text
\end{document}
